package com.flyox.game.militarychess.server.services;

import java.util.Hashtable;

import com.flyox.game.militarychess.CONSTS;
import com.flyox.game.militarychess.bean.ChessDesk;
import com.flyox.game.militarychess.bean.ChessMan.SHOWLEVEL;
import com.flyox.game.militarychess.server.services.data.SystemInfo;

public class DeskService {
	SystemInfo systemInfo=new SystemInfo();
	
	/**
	 * 取得所有棋桌信息
	 * @return
	 */
	public Hashtable<Integer, ChessDesk> getDesks() {
		return systemInfo.getDesks();
	}
	
	/**
	 * 得到棋桌信息
	 * @param deskNum
	 * @return
	 */
	public ChessDesk getChessDesk(int deskNum){
		if(deskNum<0||deskNum>=CONSTS.defaultDeskNum){
			return null;
		}
		return systemInfo.getDesks().get(deskNum);
	}
	
	public SHOWLEVEL getShowLevel(int deskNum){
		ChessDesk chessDesk=getChessDesk(deskNum);
		if(chessDesk!=null){
			return chessDesk.getShowLevel();
		}else{
			return SHOWLEVEL.NONE;
		}
	}
}
